#include <stdio.h>
#include <string.h>
int main()
{
    char a[20000],b[20000];
    int i,j,t1,t2;
    while(scanf("%s%s",a,b)!=EOF)
    {
        t1=t2=0;
        for (i=0;i<strlen(a);i++)if (a[i]=='.')t1=1;
        for (i=0;i<strlen(b);i++)if (b[i]=='.')t2=1;
        if (t1==1)
        {
            for (i=strlen(a)-1;i>=1;i--)
            {
                if (a[i]=='0')a[i]='\0';
                else break;
            }
        }
        for (i=0;i<strlen(a);i++)
        {
            if (a[i]=='0'&&strlen(a)!=1)
            {
                for (j=0;j<strlen(a)-1;j++)a[j]=a[j+1];
                a[j]='\0';
                i--;
            }
            else break;
        }
        if (t2==1)
        {
            for (i=strlen(b)-1;i>=1;i--)
            {
                if (b[i]=='0')b[i]='\0';
                else break;
            }
        }
        for (i=0;i<strlen(b);i++)
        {
            if (b[i]=='0'&&strlen(b)!=1)
            {
                for (j=0;j<strlen(b)-1;j++)b[j]=b[j+1];
                b[j]='\0';
                i--;
            }
            else break;
        }
        if (a[strlen(a)-1]=='.')a[strlen(a)-1]='\0';
        if (b[strlen(b)-1]=='.')b[strlen(b)-1]='\0';
        if (strcmp(a,b)==0)printf("YES\n");
        else printf("NO\n");
    }
    return 0;
}
